<template>
  <div class="party_building_video">
    <div class="pbv_header">
      <div class="pbv_goBack" @click="$router.back()">
        <em class="iconfont icon-zuojiantou"/>
      </div>
      <h2 v-html="headerTitle"/>
    </div>
    <div class="pbv_content">
      <div class="pbv_content_h2">
        <h2 v-html="headerTitle"/>
      </div>
      <div class="pbv_con_title">
        <div class="circle_left"></div>
        <div class="circle_right"></div>
        <div class="pbv_con_name"><span style="margin-left: -18px;">直播内容：</span></div>
        <div class="pbv_con_text">
          <template v-if="liveContent.length > 0">
            <p v-for="itemName in liveContent" :key="itemName">
              {{ itemName }}
            </p>
          </template>
          <template v-else>--</template>
        </div>
        <VideoPlayer :videoLinkAddress="videoLinkAddress" :poster="defImg"/>
      </div>
    </div>
  </div>
</template>

<script>
import VideoPlayer from "./VideoPlayer";
import defImg from  '@/assets/image/pilotT.jpg'

export default {
  name: "PilotPreach",
  components: {VideoPlayer},
  data() {
    return {
      headerTitle: "领航宣讲",
      videoLinkAddress: '', //领航宣讲url链接
      dateTimeWithoutBrackets:'',
      title:'',
      liveContent:'',
      defImg
    };
  },
  async created() {
    //提示加载中
    this.$toast.loading({
      message: "加载中...",
      forbidClick: true,
      loadingType: "spinner",
      duration: 0,
    });
    const [liveContent, title, dateTime, videoLinkAddress] = decodeURIComponent(
      this.$route.params.data
    ).split(",");
    const formatDataTime = dateTime.replaceAll('-', '/')
    this.headerTitle = `<span>${title}</span><span>${formatDataTime}</span>`; //设置页面标题
    this.liveContent = liveContent.split(/\·/g).filter((item) => item); //直播内容 按·拆分 过滤去除空字符
    this.videoLinkAddress = videoLinkAddress; //视频地址
    this.$toast.clear(); //关闭提示
  },

};
</script>


<style scoped>
@import url("~@/assets/css/partyBuildingVideo/index.css");
</style>



